Fix bad behaviour of xm when calling event.next(), by adding a different error
authorEwan Mellor <ewan@xensource.com>
Thu, 29 Mar 2007 15:18:39 +0000 (16:18 +0100)
committerEwan Mellor <ewan@xensource.com>
Thu, 29 Mar 2007 15:18:39 +0000 (16:18 +0100)
code (SESSION_NOT_REGISTERED).

Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/python/xen/xend/XendAPI.py
tools/python/xen/xm/messages/en/xen-xm.po

index 480761eff5ca738e4f79a897509efa23a98a7daa..04fc5bccca5d3bb8fd717f8c401c192bb1bf22dd 100644 (file)
@@ -1131,8 +1131,10 @@ Blocking call which returns a (possibly empty) batch of events.
 
 the batch of events
 \vspace{0.3cm}
-\vspace{0.3cm}
-\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt SESSION\_NOT\_REGISTERED}
+
+\vspace{0.6cm}
 
 \vspace{1cm}
 \newpage
@@ -13836,6 +13838,17 @@ current connection.  The handle parameter echoes the bad value given.
 \begin{verbatim}SESSION_INVALID(handle)\end{verbatim}
 \begin{center}\rule{10em}{0.1pt}\end{center}
 
+\subsubsection{SESSION\_NOT\_REGISTERED}
+
+This session is not registered to receive events.  You must call
+event.register before event.next.  The session handle you are using is
+echoed.
+
+\vspace{0.3cm}
+{\bf Signature:}
+\begin{verbatim}SESSION_NOT_REGISTERED(handle)\end{verbatim}
+\begin{center}\rule{10em}{0.1pt}\end{center}
+
 \subsubsection{VALUE\_NOT\_SUPPORTED}
 
 You attempted to set a value that is not supported by this implementation. 
index af175183b63efd5cdeb1364910c697a84a3ceef3..856a53f10ac5811b7450c4018820b1f2b73fd006 100644 (file)
@@ -122,7 +122,7 @@ def event_unregister(session, unreg_classes):
 
 def event_next(session):
     if session not in event_registrations:
-        return xen_api_error(['SESSION_INVALID', session])
+        return xen_api_error(['SESSION_NOT_REGISTERED', session])
     queue = event_registrations[session]['queue']
     events = [queue.get()]
     try:
index 6e289b4aa3a05ae1f195f28b51d35f165a2c5959..fed538a663d65114b7962b859e06699227bc3643 100644 (file)
@@ -19,7 +19,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Xen-xm 3.0\n"
-"PO-Revision-Date: 2007-03-10 23:17+0000\n"
+"PO-Revision-Date: 2007-03-29 16:13+0100\n"
 "Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
 "Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
 "MIME-Version: 1.0\n"
@@ -64,3 +64,6 @@ msgstr "The VM must be %(2)s to perform the requested operation (it is currently
 
 msgid "VM_HVM_REQUIRED"
 msgstr "HVM guest support is unavailable: is VT/AMD-V supported by your CPU and enabled in your BIOS?"
+
+msgid "SESSION_NOT_REGISTERED"
+msgstr "This session is not registered to receive events.  You must call event.register before event.next.  (Session handle is %(1)s.)"